import request from '@/utils/request'

// 查询材料请购申请列表
export function listPurchasereq(query) {
  return request({
    url: '/etc/purchasereq/list',
    method: 'get',
    params: query
  })
}

// 查询材料请购申请详细
export function getPurchasereq(id) {
  return request({
    url: '/etc/purchasereq/' + id,
    method: 'get'
  })
}

// 新增材料请购申请
export function addPurchasereq(data) {
  return request({
    url: '/etc/purchasereq',
    method: 'post',
    data: data
  })
}

// 修改材料请购申请
export function updatePurchasereq(data) {
  return request({
    url: '/etc/purchasereq',
    method: 'put',
    data: data
  })
}

// 删除材料请购申请
export function delPurchasereq(id) {
  return request({
    url: '/etc/purchasereq/' + id,
    method: 'delete'
  })
}

// 禁用材料请购申请
export function disablePurchasereq(data) {
  return request({
    url: '/etc/purchasereq/disable',
    method: 'post',
    data: data
  })
}

// 获取物料编码
export function getCodeList() {
  return request({
    url: '/erp/code/codeList',
    method: 'get'
  })
}
